package org.blogborea.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.MenuBar;


/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class blog implements EntryPoint {
    private Application app = new Application();
  /**
   * This is the entry point method.
   */
    public void onModuleLoad() {
        BlogConstants constants = (BlogConstants) GWT.create(BlogConstants.class);
        setupMainMenuPane(constants);
        setupContentPane(constants);
    }

    private void setupContentPane(BlogConstants constants) {
        
    }

    private void setupMainMenuPane(BlogConstants constants) {
        /* Home link */
        app.addLink(new HTML("<a href=\"" + BlogConstants.BLOG_HOMEPAGE + "\">"
        + constants.mainLinkHomepage() + "</a>"));
        /* account link */
        Anchor accountLink = new Anchor(constants.mainLinkAccount());
        accountLink.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                Anchor link = (Anchor)(sender);
                link.setText("logged in");//change to login action
            }
        });
        app.addLink(accountLink);
        /* search Link */
        Anchor searchLink = new Anchor(constants.mainLinkSearch());
        searchLink.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                Anchor link = (Anchor)(sender);
                link.setText("search tab");//change to login action
            }
        });
        app.addLink(searchLink);
    }

  
}
